import {messages} from "share/common";
/**
 * 操作：返回
 * 适用：所有其他单
 */
import React from 'react'
import { connect } from 'react-redux'
import menuRoute from 'routes/menuRoute'
import { Form, Button } from 'antd'

class GoBackBtn extends React.Component{
  constructor(props) {
    super(props);
    this.state = {
      otherApproveList: menuRoute.getRouteItem('approve-other','key'), //其他单审批列表页
    }
  }

  //返回
  goBack = () => {
    menuRoute.goBack(this)
  };

  render() {
    return (
      <div className="other-btn">
        <Button onClick={this.goBack}>{messages("common.back")/*返回*/}</Button>
      </div>
    )
  }
}

GoBackBtn.contextTypes = {
  router: React.PropTypes.object
};

function mapStateToProps() {
  return { }
}

const wrappedGoBackBtn = Form.create()(GoBackBtn);

export default connect(mapStateToProps)(wrappedGoBackBtn)
